package stu.servlet;

import java.io.IOException;




import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import entity.stuCourse;
import stu.dao.StudentDaoImpl;


/**
 * Servlet implementation class SaveStuServlet
 */
@WebServlet("/addbeizhu")
public class Addbeizhu extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
    public Addbeizhu() {
        super();
       
    }
    

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		 response.setCharacterEncoding("utf-8");
		 response.setContentType("text/html);charset=utf-8");
		 
			String beizhu = request.getParameter("beizhu");					
			String cname=request.getParameter("cname");	
	//		System.out.println("b="+beizhu+"  n="+cname);
			StudentDaoImpl h1=new StudentDaoImpl();		
			h1.updatebeizhu(beizhu, cname);								
		       request.getRequestDispatcher("FindCourse").forward(request, response);
			}
		

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}

